<template>
  <div class="more-action">
    <!-- 状态一 -->
    <van-cell-group v-if="!isReport">
      <van-cell @click="hUnlike">不感兴趣</van-cell>
      <van-cell is-link @click="isReport = true">反馈垃圾内容</van-cell>
      <van-cell>拉黑作者</van-cell>
    </van-cell-group>
    <!-- 状态二 反馈-->
    <van-cell-group v-if="isReport">
      <van-cell icon="arrow-left" @click="isReport = false">返回</van-cell>
      <van-cell
        v-for="item in reports"
        :key="item.value"
        @click="hReport(item.value)"
      >
        {{ item.label }}
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
import reports from '../../constant/reports'
export default {
  name: 'MoreAction',
  data () {
    return {
      reports,
      isReport: false// 是否显示状态
    }
  },
  methods: {
    hUnlike () {
      // 子传父：
      // this.$emit(事件名)
      this.$emit('un-like')
    },
    hReport (typeId) {
      // 子传父-带参
      this.$emit('report', typeId)
    }
  }

}
</script>
